package analiseSemantica;

public class Symbol {

	private String name;
	private Symbol(String n) {
		name=n; 
	}

	@SuppressWarnings("rawtypes")
	private static java.util.Dictionary dict = new java.util.Hashtable();

	public String toString() {
		return name;
	}
 	public static Symbol search(String nameVar) {
            String i = nameVar.intern();
			Symbol vs = (Symbol)dict.get(i);
            
            return vs;
        }


	@SuppressWarnings("unchecked")
	public static Symbol symbol(String n) {
		String u = n.intern();
		Symbol s = (Symbol)dict.get(u);
		if (s==null) {
			s = new Symbol(u); 
			dict.put(u,s);
 		}
		return s;
}
}